One or more aspects relate, in general, to processing within a computing environment, and in particular, to processing associated with prefetch requests.
Managed Runtime Environments (MRTEs), as well as other environments, may employ a garbage collection (GC) function to remove memory objects from a software heap that are no longer in use. This function typically has to access a large section, or perhaps all, of the heap to determine if an object is no longer referenced by any other object. Since a great deal of memory is accessed, the garbage collection function typically exploits prefetch instructions.
Examples of prefetch instructions include the Prefetch Data (PFD) and Prefetch Data Relative Long (PFDRL) instructions, as defined in the z/Architecture offered by International Business Machines Corporation, Armonk, N.Y. The prefetch instructions instruct the central processing unit (CPU) to prefetch data of a cache line into a local data cache prior to the time that cache line is needed. Therefore, when the CPU actually needs data from the cache line for a subsequent load or store instruction, it is typically already in the cache, or at least on its way to being delivered from a higher level cache or main memory.
Often, there is such a high cache miss rate that the CPU cannot service all of the prefetch requests and still provide normal load and store data that is requested. Therefore, some CPUs employ a prefetch queue (PQ) to hold these prefetch requests. If a particular CPU implementation has no queue, it can effectively be thought of as having a prefetch queue size of one request. The prefetch queue is typically examined after there is a miss in the cache, and entries are only added to it after it is known that there is a cache miss and there is a need to go to a higher level cache, or main memory, to satisfy it. In other implementations, the prefetch queue may be merged with the queue that handles all cache misses for normal loads and stores.
In many cases, speculative software prefetch requests are issued. This typically occurs when it is not known if a future branch path will be taken, but there is a chance to prefetch anyway. These speculative prefetches often significantly increase the number of prefetch requests the CPU is to process. However, in many cases these speculative prefetches do not improve performance, if they are never actually needed, and can actually decrease overall performance due to wasted cache bandwidth.